# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
_php=php82
pkgname=phpldapadmin
pkgver=1.2.6.6
pkgrel=1
pkgdesc="Web front-end for managing OpenLDAP"
url="https://www.phpldapadmin.org/"
arch="noarch"
license="GPL-2.0-or-later"
options="!check" # no test suite
depends="$_php $_php-ldap
	$_php-gettext
	$_php-mbstring
	$_php-opcache
	$_php-openssl
	$_php-session
	$_php-xml
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/leenooks/phpLDAPadmin/archive/$pkgver.tar.gz
	$pkgname.additional-template
	"
builddir="$srcdir"/phpLDAPadmin-$pkgver

# secfixes:
#   1.2.6.6-r0:
#     - CVE-2020-35132
#   1.2.3-r4:
#     - CVE-2017-11107

package() {
	mkdir -p "$pkgdir"/usr/share/webapps/phpldapadmin
	mkdir -p "$pkgdir"/etc
	mv ./* "$pkgdir"/usr/share/webapps/phpldapadmin
	mv "$pkgdir"/usr/share/webapps/phpldapadmin/config "$pkgdir"/etc/phpldapadmin
	ln -s /etc/phpldapadmin "$pkgdir"/usr/share/webapps/phpldapadmin/config
	install -Dm644 ../$pkgname.additional-template \
		"$pkgdir"/usr/share/webapps/phpldapadmin/templates/creation/groupOfNames.xml
}

sha512sums="
398bb6c36a3c9b64016bebc6debeaf8048c4b6b9ebdc7a2bfa8acfa4d4458990a0a59d4e32a2abef772baba667dd495309eff2d68e39847f25a50ad79a06984d  phpldapadmin-1.2.6.6.tar.gz
913cc89bfba3a24064865f091a3bcc6ec88db0824d750e8b3b1f6497b5ac1a1e158ced895f1f85f93607402e9353798b3dd4ccdbb1454713f96937c884456eb7  phpldapadmin.additional-template
"
